package java_test.io_test;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class FilleStreamTest {
    public static void main(String[] args) {
        try {
            byte bWrite[] = {'s', 's', 's', 's', 's', 's', 21, 's', 's', 's',};
            OutputStream os = new FileOutputStream("E:\\myTestJava\\javacode\\src\\main\\java\\java_test\\io_test\\text1.txt");
            for (int i = 0; i < bWrite.length; i++) {
                os.write(bWrite[i]);
            }
            os.close();

            InputStream is = new FileInputStream("E:\\myTestJava\\javacode\\src\\main\\java\\java_test\\io_test\\text1.txt");
            int size = is.available();
            for (int j = 0; j < size; j++) {
                System.out.print((char) is.read() + "  ");
            }
            is.close();
        } catch (Exception e) {
            System.out.println("Exception");
        }
    }
}
